package com.meatball.game.service

import com.meatball.game.data.Room

/**
 * TODO session存储全局
 *
 */
interface RoomCacheService {
    /**
     * TODO 保存room
     *
     * @param room
     */
    fun addRoom(room: Room)

    /**
     * TODO 删除room
     *
     * @param roomId
     */
    fun removeRoom(roomId: String)

    /**
     * TODO 获取room
     *
     * @param roomId
     */
    fun getRoom(roomId: String) : Room?

    /**
     * TODO 获取所以房间
     *
     * @return
     */
    fun getAllRoom() : Map<String, Room>

    /**
     * TODO 通用用户ID查询房间
     *
     * @param userId 用户ID
     */
    fun getRoomByUserId(userId: String) : Room?
}